package com.zzc.plugin;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;
import java.io.File;


public class ZZCWindowFactory implements ToolWindowFactory {
    private SettingUi settingUi;

    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        //gradle.properties

        File originalFile= new File(project.getBasePath() + "/zzcconfig.properties");
        File configFile = new File(project.getBasePath() + "/zzcconfig.local.properties");

        settingUi = new SettingUi(project,originalFile, configFile);
        ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
        Content content = contentFactory.createContent(settingUi.getMainPanel(), "", false);
        toolWindow.getContentManager().addContent(content);

    }


}
